package com.excel.comp.model;

import java.util.List;

public class ArraySelectModel {

	public String getJson(List aList) {
		StringBuffer sbf = new StringBuffer();	
		sbf.append("[");
		if(aList.size()>0) {
			Object [] objs =  (Object[]) aList.get(0);
			sbf.append("{id:'"+objs[0]+"',value:'"+objs[1]+"'}");
		}
		for(int i=1; i<aList.size(); i++) {
			Object [] objs =  (Object[]) aList.get(i);
			sbf.append(",{id:'"+objs[0]+"',value:'"+objs[1]+"'}");
		}		
		sbf.append("]");
		return sbf.toString();
	}
	
}
